/*
 * @Author: 杜家璇
 * @Date: 2023-06-12 10:39:45
 * @LastEditors: 杜家璇
 * @LastEditTime: 2023-06-12 10:39:47
 * @FilePath: \weiNingWeb\src\utils\myRem.js
 * @Description: 
 * 
 * Copyright (c) 2023 by 用户/公司名, All Rights Reserved. 
 */
//默认1920下根HTML的size为100px
windowResize();
let timer;
const BaseWidth = 7086;
const BaseFontSize = 100;
window.onresize = windowResize;
function windowResize() {
  clearTimeout(timer);
  timer = setTimeout(() => {
    let width = document.body.clientWidth;
    let widthNum = (width / BaseWidth) * BaseFontSize;
    document.documentElement.style.fontSize = widthNum + "px";
  }, 100);
}